package main

import "fmt"

type tree struct {
	value       int
	left, right *tree
}

func (t *tree) String() string {
	res := ""
	if t == nil {
		return res
	}
	res += t.left.String()
	res = fmt.Sprintf("%s %d", res, t.value)
	res += t.right.String()
	return res
}

func main() {
	var t, p, q tree
	t.value = 5
	p.value = 4
	q.value = 6
	t.left = &p
	t.right = &q

	fmt.Println(t.String())
}
